package cc.flyflow.web.controller.process;

import cc.flyflow.biz.process.service.INodeService;
import cc.flyflow.common.dto.R;
import cc.flyflow.web.controller.process.vo.NodeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 工作流 节点 控制器
 *
 * @author Jyl
 */
@RestController
@RequestMapping(value = "node")
public class NodeController
{
    @Autowired
    private INodeService nodeService;


    /**
     * 获取 节点名称
     *
     * @param procInstId 流程实例id
     * @return
     */
    @GetMapping("findByProcInstId")
    public R findByProcInstId(String procInstId)
    {
        String nodeId = nodeService.findByProcInstId(procInstId);
        return R.success(NodeVO.builder()
                .name(nodeId)
                .build());
    }

}
